import React from 'react';
import { StyleProp, Text as NativeText, TextProps as TextProperties, TextStyle } from 'react-native';
import type { RneFunctionComponent } from 'react-native-elements/dist/helpers';

export interface TextProps extends TextProperties {
  style?: StyleProp<TextStyle>;
  h1Style?: StyleProp<TextStyle>;
  h1: boolean;
}

export const Text: RneFunctionComponent<TextProps> = (
  {
    style = {},
    h1 = false,
    h1Style = {},
    children = '',
    ...rest
  }) => {
  return (
    <NativeText
      accessibilityRole={'text'}
      style={style}
      {...rest}
    >
      {children}
    </NativeText>
  );
};

Text.displayName = 'Text';
